package cn.itcast.bos.service.base.impl;

import cn.itcast.bos.Dao.base.AreaDao;
import cn.itcast.bos.domain.base.Area;
import cn.itcast.bos.service.base.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
@Service
@Transactional
public class AreaServiceImpl implements AreaService {
    @Autowired
    private AreaDao areaDao;
    @Override
    public void saveBatch(ArrayList<Area> areas) {
        areaDao.save(areas);
    }

    @Override
    public Page<Area> findPageData(Specification<Area> specification, PageRequest pageRequest) {
        return areaDao.findAll(specification,pageRequest);
    }
}
